package com.ubb.damate.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/** The persistent class for the project database table. */
@Entity
@Table(name = "project")
public class Project implements Serializable {
	private static final long	serialVersionUID	= 1L;

	@EmbeddedId
	private ProjectPK			id;

	@Temporal(TemporalType.DATE)
	@Column(name = "CreationDate", nullable = false)
	private Date				creationDate;

	//bi-directional many-to-one association to File
	@OneToMany(mappedBy = "project")
	private Set<File>			files;

	//bi-directional many-to-one association to Workspace
	@ManyToOne
	@JoinColumn(name = "WorkspaceId", nullable = false, insertable = false, updatable = false)
	private Workspace			workspace;

	public Project() {
	}

	public Project(Date creationDate) {
		this.creationDate = creationDate;
	}

	public ProjectPK getId() {
		return this.id;
	}

	public void setId(ProjectPK id) {
		this.id = id;
	}

	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public Set<File> getFiles() {
		return this.files;
	}

	public void setFiles(Set<File> files) {
		this.files = files;
	}

	public Workspace getWorkspace() {
		return this.workspace;
	}

	public void setWorkspace(Workspace workspace) {
		this.workspace = workspace;
	}

}